{% extends "base/base.html" %}
{% load i18n %}
{% block title %}{% trans 'Publicar vacante' %}{% endblock %}
{% comment %} Añadir vacantes {% endcomment %}
{% block page-header %}{% trans 'PUBLICAR VACANTE' %}{% endblock %}
{% block content %}

<!-- Content starts -->

<form action="." method="post">{% csrf_token %}
{#    {{ form.as_table }}#}
    {% for field in form %}
        <div class="thumbnail">
            {{ field.errors }}
            {{ field.label_tag }} {{ field }}
        </div>
    {% endfor %}
    <input type="submit" value="Submit">
</form>

<!-- Content ends -->

{% endblock %}

{% block java_script %}
{#    {% include "state_js.html" %}#}
    <script type="text/javascript">
        $(document).ready(function () {
{#            var x=document.getElementById("id_state");#}
{#            alert(x.value);#}
{#            var div_municipal = document.getElementById("div_municipal");#}
            $(function() {
                $('#id_country').change(
                    function() {
                        Dajaxice.companies.get_states(Dajax.process, {'option':this.value});
                        Dajaxice.companies.get_municipals(Dajax.process, {'option':0});
                    }
                );
                $('#id_state').change(
                    function() {
                        Dajaxice.companies.get_municipals(Dajax.process, {'option':this.value});
                    }
                );
                $('#id_company_area').change(
                    function() {
                        Dajaxice.companies.get_company_industries(Dajax.process, {'option':this.value});
                    }
                );
                $('#id_area').change(
                    function() {
                        Dajaxice.companies.get_industries(Dajax.process, {'option':this.value});
                    }
                );
            });
        });
    </script>
{% endblock %}